<table class="layui-table" lay-skin="line">
    <thead>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>电话</th>
            <th>学号</th>
            <th>所属班级</th>
        </tr>
    </thead>
    <tbody>
        {% for student in students %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ student.name }}</td>
                <td>{{ student.age }}</td>
                <td>{{ student.get_gender_display }}</td>
                <td>{{ student.phone }}</td>
                <td>{{ student.student_id }}</td>
                <td>{{ student.grade.grade|default:"未分配" }}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>
